package models_main

import (
	"fmt"
	"longmen/server/pkg/db/mysql/models"
	"time"
)

type PaymentApi struct {
	Id         int       `json:"id" gorm:"primaryKey;autoIncrement"` //int(11) NOT NULL AUTO_INCREMENT,
	Name       string    `json:"name"`                               //varchar(50) NOT NULL DEFAULT '' COMMENT '支付名称',
	Remark     string    `json:"remark"`                             //varchar(255) DEFAULT '' COMMENT '备注',
	Code       string    `json:"code"`                               //varchar(50) NOT NULL DEFAULT '' COMMENT '系统编码',
	ApiHost    string    `json:"api_host"`                           //varchar(255) NOT NULL DEFAULT '' COMMENT 'api请求地址',
	ApiKey     string    `json:"api_key"`                            //varchar(255) NOT NULL DEFAULT '' COMMENT 'api key',
	ApiSecret  string    `json:"api_secret"`                         //varchar(255) NOT NULL DEFAULT '' COMMENT 'api秘钥',
	ApiAccount string    `json:"api_account"`                        //varchar(50) NOT NULL DEFAULT '' COMMENT 'api账号',
	Usage      int       `json:"usage"`                              //tinyint(4) NOT NULL COMMENT '用途  1 存款 2 取款 3 存取款',
	ApiParams  string    `json:"api_params"`                         //text COMMENT '额外参数',
	Deleted    int       `json:"deleted"`                            //int(11) DEFAULT 0,
	CreateTime time.Time `json:"create_time"`                        //datetime DEFAULT NULL,
	UpdateTime time.Time `json:"update_time"`                        //datetime DEFAULT NULL,
	AppId      string    `json:"app_id"`
}

func (PaymentApi) TableName() string {
	return fmt.Sprintf("%spayment_api", models.Prefix)
}
